<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

?>
<form action="index.php?option=com_letterman&controller=subscribers" method="post" name="adminForm" id="adminForm">

<table class="adminheading">
	<tr>
		<td width="100%">
			<label for="search"><?php echo JText::_( 'Filter' ) ?> : </label>
			<input type="text" name="search" id="search" value="<?php echo $this->search ?>" class="text_area" title="<?php echo JText::_( 'Filter by name or email' );?>"/>
			<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ) ?></button>
			<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
		</td>
	</tr>
</table>

<table class="adminlist">
	<thead>
		<tr>
			<th width="1%" class="title">#</th>
			<th width="2%">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->rows ) ?>);" />
			</th>
			<th width="40%" nowrap="nowrap"><?php echo JHTML::_('grid.sort', 'Subscriber name', 'name', $this->order_dir , $this->order ) ?></th>
			<th width="35%" nowrap="nowrap"><?php echo JHTML::_('grid.sort', 'Subscriber email', 'email', $this->order_dir , $this->order ) ?></th>
			<th width="20%" nowrap="nowrap"><?php echo JHTML::_('grid.sort', 'Signup date', 'subscribe_date', $this->order_dir , $this->order ) ?></th>
			<th width="2%" nowrap="nowrap"><?php echo JHTML::_('grid.sort', 'Confirmed', 'confirmed', $this->order_dir , $this->order ) ?></th>
		</tr>
	</thead>

	<tfoot>
		<tr>
			<td colspan="6">
				<del class="container">
					<div class="pagination">
						<div class="limit">
							<?php echo JText::_('Items per page')?> :&nbsp;&nbsp;
							<?php echo $this->pagination->getLimitBox() ?>&nbsp;&nbsp;
						</div>
						<?php echo $this->pagination->getPagesLinks() ?>
						<div class="limit"><?php echo $this->pagination->getPagesCounter() ?></div>
					</div>
				</del>
			</td>
		</tr>
	</tfoot>

	<tbody>

	<?php foreach ($this->rows as $k => $row) :?>

	<?php $altrow = empty($altrow)? 1 : 0 ?>

		<tr class="row<?php echo $altrow ?>">
			<td><?php echo $k ?></td>
			<td><?php echo JHTML::_('grid.id',   $k, $row->id ) ?></td>
			<td><a href="#edit" onclick="return listItemTask('cb<?php echo $k ?>','edit')"><?php echo $this->escape( $row->name ) ?></a></td>
			<td><?php echo $this->escape( $row->email ) ?></td>
			<td><?php echo JHTML::_('date', $row->subscribe_date , JText::_('DATE_FORMAT_LC2') )?></td>
			<td align="center"><?php echo $this->confirmed( $row, $k ) ?></td>
		</tr>

		<?php endforeach ?>

	</tbody>

</table>

<div>
	<input type="hidden" name="task" value="" /> 
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->order ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->order_dir ?>" />
	<input type="hidden" name="limitstart" value="<?php echo $this->limitstart ?>" />
	<?php echo JHTML::_( 'form.token' ) ?>
</div>

</form>